package com.eflow.model.domain;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eflow.model.e.TaskStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import liquibase.pro.packaged.B;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 任务待办对象 eflow_task
 *
 * @author eflow
 * @date 2021-02-26
 */
@TableName("eflow_task")
@Accessors(chain=true)
@Data
public class EflowTask extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 任务id */
    private String taskId;

    /** 节点Id */
    private String activityId;

    /** 任务名 */
    private String taskName;

    /** 流程名 */
    private String processName;

    /** 用户Id */
    private String userId;

    /** 真实姓名 */
    private String realName;


    /** 被代理用户Id */
    private String proxyUserId;

    /** 被代理用户真实姓名 */
    private String proxyRealName;

    /** 流程实例id */
    private String processInstanceId;

    /** 部门名 */
    private String deptName;

    /** $column.columnComment */
    private String deptId;

    /** 部门名 */
    private String proxyDeptName;

    /** $column.columnComment */
    private String proxyDeptId;

    /** 标题 */
    private String title;

    /** 业务id */
    private String businessId;

    /** 业务类型 */
    private String businessType;

    /** 删除状态 */
    @TableLogic
    private Integer delFlag;

    /** $column.columnComment */
    private Date endDate;

    /** $column.columnComment */
    private Date startDate;

    /** $column.columnComment */
    private String processDefinitionId;

    /** 任务状态，0待办，1已办 */
    private Integer status;

    /** 评论 */
    private String comments;

    /** 评论类型 */
    private Integer commentType;
    /** 终端类型 */
    private Integer terminalType;
    /** 是否被代理 */
    private Boolean proxy;

    public void setStatus(Integer status) {
        this.status = status;
    }

    public EflowTask setStatus(TaskStatus status) {
        this.status = status.getCode();
        return this;
    }
}
